package edu.yzu.testspringboot002.common.enums;

import lombok.Getter;

/**
 * http代码枚举
 *
 * @author yulang
 * @date 2023-08-10
 */
public enum HttpCodeEnum {

    /**
     * 没有 登录
     */
    NO_LOGIN(4000,"用户未登录！"),
    /**
     * 令牌无效
     */
    TOKEN_INVALID(4001,"token信息无效！"),

    INDETIFY_EXPIRED(4002,"用户身份过期"),

    REQUEST_REJECT(5000,"请求被拦截！"),

    REQUEST_REPEATED(6000,"请求过于频繁！");

    @Getter
    private final Integer code;

    @Getter
    private final String desc;

    /**
     * http代码枚举
     *
     * @param code 代码
     * @param desc desc
     */
    HttpCodeEnum(Integer code,String desc){
        this.code = code;
        this.desc = desc;
    }
}
